<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%@ include file="../common/include/header.jsp" %>

<%@ page import="java.util.*,util.*" %>
<jsp:useBean id="menu" class="util.Menu" scope="session"></jsp:useBean>

<div style="width: 980px;">
<table border="0" cellpadding="0" cellspacing="0" width="980px">
	<tr>
		<td style="vertical-align: top;width: 180px;background-color: #6383c2;">
			<div style="width: 180px;height: 40px;background: black;color: white;font-weight: bold;text-align: center;padding-top: 20px;">
				<span>회원 정보 변경</span>
			</div>
			<div style="width: 180px;height: 20px;font-weight: bold;text-align: center;padding-top: 10px;color: white;font-size: 1em;">
				<a href="<%=path %>/member/signout.do" style="color: white;"><span>탈퇴 신청</span></a>
			</div>
		</td>
		
		<td style="text-align: center;width: 800px;background: #ffffff; vertical-align: top;">
<div id="updateDiv" style="width: 800px;">

<table style="width: 800px;" cellpadding="0" cellspacing="0">
	<tr><td style="width: 600px;text-align: center;padding-top: 10px;">
<html:form action="updateaction.do" enctype="multipart/form-data">
	<table style="width: 500px;text-align: left;border: 1px solid #6383c2;">
		<tr><td style="background: #6383c2;text-align: center;height: 30px;font-weight: bold;padding: 4px;color: white;" colspan="2">회원정보</td></tr>
		<tr><td class="tdupdateform">아이디</td>
			<td><bean:write name="memberForm" property="mid"/>
			</td></tr>
		<tr><td class="tdupdateform">패스워드</td>
			<td><html:password property="mpass" size="12" maxlength="12" style="IME-MODE: disabled;width: 80px;"></html:password>
			
			</td></tr>
		<tr><td class="tdupdateform">패스워드 확인</td>
			<td style="color: red;"><input type="password" name="mpass2" size="12" maxlength="12" style="IME-MODE: disabled;width: 80px;"/>
			&nbsp;*패스워드를 입력 하셔야 정보를 변경할 수있습니다.
			</td></tr>
		<tr><td class="tdupdateform">이름</td>
			<td><bean:write name="memberForm" property="mname"/>
			</td></tr>
		<tr><td class="tdupdateform">생년월일</td>
			<td><bean:write name="memberForm" property="mbirth"/>
			<html:checkbox property="mobirth">공개</html:checkbox>
			</td></tr>
		<tr><td class="tdupdateform">가입일</td>
			<td><bean:write name="memberForm" property="mregdate"/>
			</td></tr>
		<tr><td class="tdupdateform">회원등급</td>
			<td><bean:write name="memberForm" property="lvno"/>
			</td></tr>
			
		<tr><td class="tdupdateform">이메일</td>
			<td><html:text property="memail" style="width: 300px;" style="IME-MODE: disabled"></html:text>
			<html:checkbox property="moemail">공개</html:checkbox>
			<logic:messagesPresent><div><html:messages id="errors" property="error.memail"><font color="red">
			<bean:write name="errors"></bean:write></font></html:messages></div></logic:messagesPresent>
			</td></tr>
			
		<tr><td class="tdupdateform">집주소</td>
			<td><html:text property="maddressh" style="width: 300px;"></html:text>
			<html:checkbox property="moaddressh">공개</html:checkbox></td></tr>
			
		<tr><td class="tdupdateform">휴대전화</td>
			<td><html:text property="mphoneh" style="width: 300px;"></html:text>
			<html:checkbox property="mophoneh">공개</html:checkbox></td></tr>
			
		<tr><td class="tdupdateform">사무실주소</td>
			<td><html:text property="maddresso" style="width: 300px;"></html:text>
			<html:checkbox property="moaddresso">공개</html:checkbox></td></tr>

		<tr><td class="tdupdateform">사무실전화</td>
			<td><html:text property="mphoneo" style="width: 300px;"></html:text>
			<html:checkbox property="mophoneo">공개</html:checkbox></td></tr>
			
		<tr><td class="tdupdateform">자기소개</td>
			<td><html:textarea rows="4" property="mintro" style="width:300px;"></html:textarea>
			<html:checkbox property="mointro">공개</html:checkbox></td></tr>
	
		<tr><td class="tdupdateform">사진</td>
			<td><div><html:file property="mphoto" style="width: 306px;"></html:file>
			<html:checkbox property="mophoto">공개</html:checkbox></div>
<logic:notEmpty name="memberForm" property="mphotosfn"><div>
			<img name="photo" src="<%=request.getContextPath() %>/uploadfiles/<%=user.getUserInfo().getMphotosfn()%>" onload="resizeImage()"/></div>
			<div><bean:write name='memberForm' property='mphotoofn'/></div>
</logic:notEmpty>
</td></tr>
		<tr><td class="tdupdateform">메일링리스트</td>
			<td><html:checkbox property="momailing">MYITEA 뉴스를 수신하겠습니다.</html:checkbox></td></tr>

		<tr><td colspan="2" align="center">
			<html:hidden property="mphotosfn"/>
			<html:hidden property="mphotoofn"/>
			<input type="submit" onclick="return checkForms()" value="정보변경"/><input type="hidden" name="method" value="update"/>
			</td></tr>	
	</table>
</html:form>
	</td>
	<td style="width: 200px;vertical-align: top;"><img src="<%=imagePath %>memberupdate.jpg" border="0"/></td>
	</tr>
</table>
</div>

		</td>
	</tr>
</table>
</div>
<script type="text/javascript">
<!--
	function resizeImage(){
		var w = document.photo.width;
		if(w>400){
			document.getElementById('photo').width = 300;
		}
	}
	
	function checkForms(){
		var inputforms = updateDiv.getElementsByTagName('input');
		mpass = inputforms[0].value;
		mpassConfirm = inputforms[1].value;
		if(mpass!=mpassConfirm){
			alert("패스워드를 확인해 주세요.");
			inputforms[1].focus();
			return false;
		}

		var inputforms = updateDiv.getElementsByTagName('input');
		memail = inputforms[3].value;
		if(memail==""){
			alert("이메일을 확인해 주세요.");
			inputforms[3].focus();
			return false;
		}
	}
//-->
</script>
<%@ include file="../common/include/footer.jsp" %>
